import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '车牌号',
    align:"center",
    sorter: true,
    dataIndex: 'licensePlateNumber'
   },
   {
    title: '所属公司',
    align:"center",
    sorter: true,
    dataIndex: 'affiliatedCompany'
   },
   {
    title: '车牌颜色',
    align:"center",
    dataIndex: 'licensePlateColor'
   },
   {
    title: '线路',
    align:"center",
    dataIndex: 'linesOperation'
   },
   {
    title: '品牌',
    align:"center",
    dataIndex: 'brand'
   },
   {
    title: '颜色',
    align:"center",
    dataIndex: 'color'
   },
   {
    title: '车辆类型',
    align:"center",
    dataIndex: 'vehicleType'
   },
   {
    title: '联系人',
    align:"center",
    dataIndex: 'contacts'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'contactNumber'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remarks'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "车牌号",
      field: 'licensePlateNumber',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "所属公司",
      field: 'affiliatedCompany',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "线路",
      field: 'linesOperation',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '车牌号',
    field: 'licensePlateNumber',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入车牌号!'},
          ];
     },
  },
  {
    label: '所属公司',
    field: 'affiliatedCompany',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入所属公司!'},
          ];
     },
  },
  {
    label: '车牌颜色',
    field: 'licensePlateColor',
    component: 'Input',
  },
  {
    label: '线路',
    field: 'linesOperation',
    component: 'Input',
  },
  {
    label: '品牌',
    field: 'brand',
    component: 'Input',
  },
  {
    label: '颜色',
    field: 'color',
    component: 'Input',
  },
  {
    label: '车辆类型',
    field: 'vehicleType',
    component: 'Input',
  },
  {
    label: '联系人',
    field: 'contacts',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'contactNumber',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remarks',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  licensePlateNumber: {title: '车牌号',order: 0,view: 'text', type: 'string',},
  affiliatedCompany: {title: '所属公司',order: 1,view: 'text', type: 'string',},
  licensePlateColor: {title: '车牌颜色',order: 2,view: 'text', type: 'string',},
  linesOperation: {title: '线路',order: 3,view: 'text', type: 'string',},
  brand: {title: '品牌',order: 4,view: 'text', type: 'string',},
  color: {title: '颜色',order: 5,view: 'text', type: 'string',},
  vehicleType: {title: '车辆类型',order: 6,view: 'text', type: 'string',},
  contacts: {title: '联系人',order: 7,view: 'text', type: 'string',},
  contactNumber: {title: '联系电话',order: 8,view: 'text', type: 'string',},
  remarks: {title: '备注',order: 9,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}